namespace DataProvider.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class x : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.SageFields",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Namespace = c.String(),
                        Name = c.String(),
                        Type = c.String(),
                        IsStatic = c.Boolean(nullable: false),
                        IsPublic = c.Boolean(nullable: false),
                        IsProtected = c.Boolean(nullable: false),
                        IsVirtual = c.Boolean(nullable: false),
                        VersionId = c.Int(nullable: false),
                        Assembly = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.SageMethods",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        ReturnType = c.String(),
                        IsProperty = c.Boolean(nullable: false),
                        Namespace = c.String(),
                        Name = c.String(),
                        Type = c.String(),
                        IsStatic = c.Boolean(nullable: false),
                        IsPublic = c.Boolean(nullable: false),
                        IsProtected = c.Boolean(nullable: false),
                        IsVirtual = c.Boolean(nullable: false),
                        VersionId = c.Int(nullable: false),
                        Assembly = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.SageArguments",
                c => new
                    {
                        ArgumentId = c.Int(nullable: false, identity: true),
                        MethodId = c.Int(nullable: false),
                        Name = c.String(),
                        Type = c.String(),
                        Qualifier = c.String(),
                        SageMethod_Id = c.Int(),
                    })
                .PrimaryKey(t => t.ArgumentId)
                .ForeignKey("dbo.SageMethods", t => t.SageMethod_Id)
                .Index(t => t.SageMethod_Id);
            
            CreateTable(
                "dbo.SageVersions",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        MajorVersion = c.Int(nullable: false),
                        MinorVersion = c.Int(nullable: false),
                        Build = c.Int(nullable: false),
                        Revision = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.SageArguments", "SageMethod_Id", "dbo.SageMethods");
            DropIndex("dbo.SageArguments", new[] { "SageMethod_Id" });
            DropTable("dbo.SageVersions");
            DropTable("dbo.SageArguments");
            DropTable("dbo.SageMethods");
            DropTable("dbo.SageFields");
        }
    }
}
